#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) { 
    int n = 0;
    scanf("%d",n);
	char* arr[n] = {0};
	int t = 0;
	scanf("%s,%s,%s",arr[0],arr[1],arr[2]);
	if(strcmp(&arr[0],&arr[1]) != 0 && strcmp(&arr[1],&arr[2]))
	{
		t++;
	}
	printf("%d",t);
	return 0;
}
